#ifndef __ming_fyp_BasicGui_h__
#define __ming_fyp_BasicGui_h__

//------------------------------------------------------------------------------
// header includes

#include "fyp/core/String.h"

class CDXUTControl;
class CDXUTDialog;

//------------------------------------------------------------------------------
namespace ming
{
namespace fyp
{
	class TGuiManager;

	//--------------------------------------------------------------------------
	class TGui
	{
	public:
		//------------------------------
		// #cstor & #dstor
		TGui(TGuiManager *guiMgr, const TStr &dlgName);
		virtual ~TGui();
		
		//------------------------------
		// external operations
		virtual void OnControlEvent(int controlId, CDXUTControl *control) {}

		static void __stdcall EventCallback(
			unsigned int nEvent,
			int nControlID,
			CDXUTControl* pControl,
			void* pUserContext);
		
	protected:
		//------------------------------
		// internal attributes
		CDXUTDialog *mDlg;
		TGuiManager *mGuiMgr;
		TStr mDlgName;

		//------------------------------
		// internal operations
	};

	//--------------------------------------------------------------------------
	template<class ModelType>
	class GuiImpl_t : public TGui
	{
	public:
		GuiImpl_t(ModelType *model, TGuiManager *guiMgr, const TStr &dlgName) : TGui(guiMgr, dlgName)
		{
			mModel = model;
		}

		virtual ~GuiImpl_t()
		{
		}

	protected:
		ModelType *mModel;
	};
	
	//--------------------------------------------------------------------------
}
}


#endif	//__ming_fyp_BasicGui_h__